@extends('layouts.base')

@section('navbar')
<section class="content-header">
    <h1>首页</h1>
    <ol class="breadcrumb">
        <li><i class="fa fa-dashboard"></i> 当前位置</li>
        <li class="active">首页</li>
    </ol>
</section>
@endsection

@section('content')
<div class="box box-primary">
<!-- 加载提示信息 -->
@include('message')
    <div class="box-body">
        <div class="panel panel-default">
            <div class="panel-heading">新闻列表</div>
            <table class="table table-striped table-hover table-responsive">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>标题</th>
                    <th>作者</th>
                    <th>内容</th>
                    <th width="120">操作</th>
                </tr>
                </thead>
                <tbody>
                    @foreach($newss as $news)
                    <tr>
                        <th scope="row">{{ $news->id }}</th>
                        <td>{{ $news->title }}</td>
                        <td>{{ $news->author }}</td>
                        <td>{{ $news->content }}</td>
                        <td>
                        <a href="{{ url('/detail', ['id' => $news->id ]) }}">详情</a>
                            <a href="{{ url('/update', ['id' => $news->id ]) }}">修改</a>
                            <a href="{{ url('/delete', ['id' => $news->id ]) }}" 
    onclick="if(confirm('确定删除？') == false) return false">删除</a>
                        </td>
                    </tr>
                    @endforeach
                
                </tbody>
            </table>
            </div>

            <!-- 分页  -->
            <div>
                <div class="pull-right">
                    {{ $newss->render() }}
                </div>
            </div>

        </div>
        
        <div class="box-footer">
            <div class="col-md-2">
               
            </div>
        </div>

    </div>
    <div class="box-footer">
        <div class="alert alert-info alert-dismissible">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <h4><i class="icon fa fa-info"></i> 温馨提示</h4>
            <ol>
                <li>温馨提示温馨提示温馨提示</li>
                <li>温馨提示温馨提示温馨提示</li>
            </ol>
        </div>
    </div>
</div>
@endsection

@section('scripts')

@endsection